package www.wf.pro.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import www.wf.pro.model.ResultModel;
import www.wf.pro.request.AdminRequest;
import www.wf.pro.response.AdminResponse;

/**
 * @author wang fei
 * @date 2020-07-29 17:24
 */

@RestController
@RequestMapping("index")
public class IndexController extends BaseController{

    private static final Logger log = LoggerFactory.getLogger(IndexController.class);

    @PostMapping("login")
    public ResultModel<AdminResponse> login (@RequestBody AdminRequest request){
        log.info("********进入生产者********");
        return adminService.login(request);
    }

    @PostMapping("register")
    public ResultModel<Integer> register(@RequestBody AdminRequest request){
        return  adminService.register(request);
    }

}
